<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>字符反转</title>
  </head>
  <body>
    <script src="https://unpkg.com/vue@next"></script>

    <div id="root"></div>

    <script>
      Vue.createApp({
        data() {
          return {
            content: "hello world",
          };
        },
        methods: {
          hanleBtnClick() {
            this.content = this.content.split("").reverse().join("");
          },
        },

        template: `
                    <div>{{content}}</div>
                    <button v-on:click="hanleBtnClick">点我反转</button>
                    `,
      }).mount("#root");
    </script>
  </body>
</html>
